package com.example.demo.core.handler.exception;

public class ResultTool {
    public static ResultBO<?> error(ExceptionInfoBO exceptionInfoBO) {
        ResultBO<?> result = new ResultBO<>();
        result.setCode(exceptionInfoBO.getStatus());
        result.setMsg(exceptionInfoBO.getMessage());
        return result;
    }

    public static ResultBO<?> success(Object data) {
        ResultBO<Object> result = new ResultBO<>();
        result.setCode(200);
        result.setMsg("success");
        result.setData(data);
        return result;
    }
}
